functions.js ➔ loadJSON   A
last analyzed

Complexity

Conditions 1
Paths 2

Size

Total Lines 14
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 14
rs 10
c 1
b 0
f 0
cc 1
nc 2
nop 2

1 Function

Rating   Name   Duplication   Size   Complexity  
A functions.js ➔ ... ➔ xobj.onreadystatechange 0 6 3
1
function loadJSON(filename, callback)
2
{
3
4
    var xobj = new XMLHttpRequest();
5
    xobj.overrideMimeType("application/json");
6
    xobj.open('GET', filename, true);
7
    xobj.onreadystatechange = function () {
8
        if (xobj.readyState == 4 && xobj.status == "200") {
9
            // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
10
            callback(xobj.responseText);
11
        }
12
    };
13
    xobj.send(null);
14
}
15
16
17
function equalsHeightOf(node1, node2)
18
{
19
    var w1 = node1.style.height;
20
    node2.style.height = w1 + 'px';
21
22
}